home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
RSPB Wildlife Explorers Mammal Guide
/
Mammals Guide.iso
/
mac
/
bird_info.swf
/
scripts
/
frame_5
/
DoAction.as
Wrap
Text File
|
2008-07-31
|
18KB
|
415 lines
function BirdInfo(tl)
{
this.parent = _global.appTL.rspbBG;
this.contentTL = tl;
this.playerTL = _global.appTL;
this.contentTL.back_btn.section = "Back";
this.contentTL.back_btn.onRelease = function()
{
_global.appTL.rspbBG.nav.goBack();
};
this.lastBirdID = null;
this.birdID = this.parent.birdID;
this.parent.AddBird = undefined;
this.videoLoaded = false;
this.setUpPage();
this.mouseListener = new Object();
this.mouseListener.parent = this;
this.mouseListener.onMouseWheel = function(delta)
{
this.parent.contentTL.ref_sp.wheelScroll(delta);
};
Mouse.addListener(this.mouseListener);
}
BirdInfo.prototype.setUpPage = function()
{
var _loc5_ = this.parent.guideXML.firstChild.childNodes[this.birdID];
this.contentTL.species_txt.text = _loc5_.childNodes[2].childNodes[0].nodeValue;
this.contentTL.family_txt.text = _loc5_.childNodes[5].childNodes[0].nodeValue;
this.contentTL.createEmptyMovieClip("scroller_mc",1);
this.contentTL.scroller_mc._x = 0;
this.contentTL.scroller_mc.attachMovie("scrollingMC","scrollingMC",1);
var _loc12_ = System.capabilities.os.charAt(0);
if(_loc12_ == "M")
{
this.contentTL.scroller_mc.scrollingMC.media_mc.pic_holder_mc.pic_mc.loadMovie(_global.mdmPath + "images:info:" + _loc5_.childNodes[0].attributes.IMG + ".jpg");
}
else
{
this.contentTL.scroller_mc.scrollingMC.media_mc.pic_holder_mc.pic_mc.loadMovie(_global.mdmPath + "images/info/" + _loc5_.childNodes[0].attributes.IMG + ".jpg");
}
if(_loc5_.childNodes[0].attributes.MAP.length > 1)
{
this.contentTL.scroller_mc.scrollingMC.media_mc.map_holder_mc._visible = false;
if(_loc12_ == "M")
{
this.contentTL.scroller_mc.scrollingMC.media_mc.map_holder_mc.map_mc.loadMovie(_global.mdmPath + "images:maps:" + _loc5_.childNodes[0].attributes.MAP + ".jpg");
}
else
{
this.contentTL.scroller_mc.scrollingMC.media_mc.map_holder_mc.map_mc.loadMovie(_global.mdmPath + "images/maps/" + _loc5_.childNodes[0].attributes.MAP + ".jpg");
}
}
if(_loc5_.childNodes[0].attributes.VIDEO.length > 1)
{
this.contentTL.scroller_mc.scrollingMC.media_mc.video_btn.linkID = this.birdID;
this.contentTL.scroller_mc.scrollingMC.media_mc.video_btn.obj = this;
this.contentTL.scroller_mc.scrollingMC.media_mc.video_btn.onRelease = function()
{
this.obj.playVideo(this.linkID);
};
}
else
{
this.contentTL.scroller_mc.scrollingMC.media_mc.video_btn._visible = false;
}
this.contentTL.scroller_mc.scrollingMC.media_mc.img_btn.obj = this;
this.contentTL.scroller_mc.scrollingMC.media_mc.img_btn.onRelease = function()
{
this.obj.hideVideo();
this.obj.hideMap();
this.obj.contentTL.scroller_mc.scrollingMC.media_mc.img_btn.enabled = false;
this.obj.contentTL.scroller_mc.scrollingMC.media_mc.img_btn.gotoAndStop("_selected");
};
if(_loc5_.childNodes[0].attributes.SOUND.length > 1)
{
this.contentTL.scroller_mc.scrollingMC.media_mc.sound_btn.linkID = this.birdID;
this.contentTL.scroller_mc.scrollingMC.media_mc.sound_btn.obj = this;
this.contentTL.scroller_mc.scrollingMC.media_mc.sound_btn.onRelease = function()
{
this.obj.playSound(this.linkID);
this.obj.hideMap();
};
}
else
{
this.contentTL.scroller_mc.scrollingMC.media_mc.sound_btn._visible = false;
}
if(_loc5_.childNodes[0].attributes.MAP.length > 1)
{
this.contentTL.scroller_mc.scrollingMC.media_mc.map_btn.linkID = this.birdID;
this.contentTL.scroller_mc.scrollingMC.media_mc.map_btn.obj = this;
this.contentTL.scroller_mc.scrollingMC.media_mc.map_btn.onRelease = function()
{
this.obj.hideVideo();
this.obj.showMap();
};
}
else
{
this.contentTL.scroller_mc.scrollingMC.media_mc.map_btn._visible = false;
}
this.contentTL.scroller_mc.scrollingMC.add_sighting.linkID = this.birdID;
this.contentTL.scroller_mc.scrollingMC.add_sighting.parent = this;
this.contentTL.scroller_mc.scrollingMC.add_sighting.onRelease = function()
{
this.parent.loadInfo(this.linkID);
};
this.contentTL.scroller_mc.scrollingMC.edit_sighting.linkID = this.birdID;
this.contentTL.scroller_mc.scrollingMC.edit_sighting.parent = this;
this.contentTL.scroller_mc.scrollingMC.edit_sighting.onRelease = function()
{
this.parent.EditInfo(this.linkID);
};
var myBirdSeen = false;
for(var _loc19_ in this.parent.mybirdsData.myBirdsListArray)
{
if(this.birdID == Number(this.parent.mybirdsData.myBirdsListArray[_loc19_][0]))
{
var _loc8_ = [];
_loc8_ = this.parent.mybirdsData.myBirdsListArray[_loc19_];
var myBirdSeen = true;
break;
}
}
if(myBirdSeen)
{
this.contentTL.scroller_mc.scrollingMC.add_sighting._visible = false;
this.contentTL.scroller_mc.scrollingMC.edit_sighting._visible = true;
}
else
{
this.contentTL.scroller_mc.scrollingMC.add_sighting._visible = true;
this.contentTL.scroller_mc.scrollingMC.edit_sighting._visible = false;
}
this.contentTL.scroller_mc.scrollingMC.mb_indicator_mc.obj = this;
this.contentTL.scroller_mc.scrollingMC.mb_indicator_mc.linkID = this.birdID;
this.contentTL.scroller_mc.scrollingMC.mb_indicator_mc.myBirdSeen = myBirdSeen;
this.contentTL.scroller_mc.scrollingMC.mb_indicator_mc.onRelease = function()
{
if(!this.myBirdSeen)
{
this.gotoAndStop(2);
var _loc2_ = new Sound(this);
_loc2_.attachSound("mybirds");
_loc2_.start();
this.obj.addToMyBirds(this.linkID);
this.myBirdSeen = true;
}
else
{
this.gotoAndStop(1);
this.obj.removeFromMyBirds(this.linkID);
this.myBirdSeen = false;
}
};
var _loc14_ = this.contentTL.scroller_mc.scrollingMC.attachMovie("introduction","introduction",1);
_loc14_._txt.text = _loc5_.childNodes[4].childNodes[0].nodeValue;
_loc14_._txt.autoSize = true;
_loc14_._txt.multiline = true;
_loc14_._txt.wordWrap = true;
_loc14_._y = 15;
var _loc16_ = this.contentTL.scroller_mc.scrollingMC.attachMovie("status","status",2);
var _loc25_ = _loc5_.childNodes[3].childNodes[0].nodeValue;
_loc16_._txt.text = _loc25_;
_loc16_._txt.autoSize = true;
_loc16_._txt.multiline = true;
_loc16_._txt.wordWrap = true;
_loc16_._y = _loc14_._y + _loc14_._height + 10;
var _loc13_ = this.contentTL.scroller_mc.scrollingMC.attachMovie("idTips","idTips",3);
_loc13_._txt.text = _loc5_.childNodes[6].childNodes[0].nodeValue;
_loc13_._txt.autoSize = true;
_loc13_._txt.multiline = true;
_loc13_._txt.wordWrap = true;
_loc13_._y = _loc16_._y + _loc16_._height + 15;
var _loc15_ = this.contentTL.scroller_mc.scrollingMC.attachMovie("whereAndWhen","whereAndWhen",4);
_loc15_._txt.text = _loc5_.childNodes[7].childNodes[0].nodeValue;
_loc15_._txt.autoSize = true;
_loc15_._txt.multiline = true;
_loc15_._txt.wordWrap = true;
_loc15_._y = _loc13_._y + _loc13_._height + 10;
var _loc11_ = this.contentTL.scroller_mc.scrollingMC.attachMovie("whatItEats","whatItEats",5);
_loc11_._txt.text = _loc5_.childNodes[8].childNodes[0].nodeValue;
_loc11_._txt.autoSize = true;
_loc11_._txt.multiline = true;
_loc11_._txt.wordWrap = true;
_loc11_._y = _loc15_._y + _loc15_._height + 10;
var _loc22_ = _loc5_.childNodes[9].childNodes[0].childNodes[0].nodeValue;
var _loc17_ = _loc5_.childNodes[9].childNodes[1].childNodes.length;
var _loc21_ = _loc5_.childNodes[9].childNodes[1].childNodes[0].childNodes[0].nodeValue;
var _loc24_ = _loc5_.childNodes[9].childNodes[1].childNodes[0].childNodes[0].nodeValue;
var _loc26_ = false;
if(_loc17_ > 0 && _loc22_ == undefined)
{
_loc22_ = "See the list on the right.";
}
if(_loc21_ != undefined)
{
_loc26_ = true;
if(_loc17_ > 0 && _loc21_ != undefined && _loc24_ != undefined)
{
this.contentTL.scroller_mc.scrollingMC._txt.text = "Easily confused with (on this CD)";
var _loc3_ = 0;
while(_loc3_ < _loc17_)
{
var _loc4_ = this.contentTL.scroller_mc.scrollingMC.holder_mc.attachMovie("otherbirds","otherbirds" + _loc3_,_loc3_);
var linkID = _loc5_.childNodes[9].childNodes[1].childNodes[_loc3_].attributes.LINK_ID;
var _loc9_ = _loc5_.childNodes[9].childNodes[1].childNodes[_loc3_].childNodes[0].nodeValue;
_loc4_.parent = this;
_loc4_.link_txt.htmlText += "<u><a href=\'asfunction:parent.getPage, " + linkID + "\'>" + _loc9_ + "</a></u>";
var _loc7_ = this.parent.guideXML.firstChild.childNodes[linkID - 1].childNodes[0].attributes.IMG;
if(_loc12_ == "M")
{
_loc4_.pic_mc.loadMovie(_global.mdmPath + "images:thumb:" + _loc7_ + ".jpg");
}
else
{
_loc4_.pic_mc.loadMovie(_global.mdmPath + "images/thumb/" + _loc7_ + ".jpg");
}
_loc4_._y = 14 + 72 * _loc3_;
_loc3_ = _loc3_ + 1;
}
}
}
var _loc20_ = _loc5_.childNodes[10].childNodes[0].childNodes[0].nodeValue;
_loc17_ = _loc5_.childNodes[10].childNodes.length;
if(_loc20_ != undefined)
{
var _loc10_ = this.contentTL.scroller_mc.scrollingMC.attachMovie("possibilities","possibilities",7);
if(_loc17_ > 0)
{
_loc10_._txt.text = "";
var _loc6_ = 0;
while(_loc6_ < _loc17_)
{
_loc10_._txt.text += _loc5_.childNodes[10].childNodes[_loc6_].childNodes[0].nodeValue + "\n";
_loc6_ = _loc6_ + 1;
}
}
else
{
_loc10_._txt.text = _loc20_;
}
_loc10_._txt.autoSize = true;
_loc10_._txt.multiline = true;
_loc10_._txt.wordWrap = true;
_loc10_._y = _loc11_._y + _loc11_._height + 10;
}
var _loc18_ = this.contentTL.scroller_mc.scrollingMC.attachMovie("didYouKnow","didYouKnow",8);
_loc18_._txt.text = _loc5_.childNodes[11].childNodes[0].nodeValue;
_loc18_._txt.autoSize = true;
_loc18_._txt.multiline = true;
_loc18_._txt.wordWrap = true;
if(_loc20_ != undefined)
{
_loc18_._y = _loc10_._y + _loc10_._height + 10;
}
else
{
_loc18_._y = _loc11_._y + _loc11_._height + 10;
}
this.contentTL.scroller_mc.scrollingMC.media_mc.video_btn.enabled = true;
this.contentTL.scroller_mc.scrollingMC.media_mc.video_btn.gotoAndStop("_up");
this.contentTL.scroller_mc.scrollingMC.media_mc.img_btn.enabled = false;
this.contentTL.scroller_mc.scrollingMC.media_mc.img_btn.gotoAndStop("_selected");
this.contentTL.scroller_mc.scrollingMC.media_mc.sound_btn.enabled = true;
this.contentTL.scroller_mc.scrollingMC.media_mc.sound_btn.gotoAndStop("_up");
this.contentTL.scroller_mc.scrollingMC.media_mc.map_btn.enabled = true;
this.contentTL.scroller_mc.scrollingMC.media_mc.map_btn.gotoAndStop("_up");
this.contentTL.ref_sp.setScrollContent(this.contentTL.scroller_mc);
this.contentTL.ref_sp.refreshPane();
};
BirdInfo.prototype.loadInfo = function(pageID)
{
this.parent.nav.loadSection(5,pageID);
this.parent.AddBird = pageID;
};
BirdInfo.prototype.EditInfo = function(pageID)
{
this.parent.nav.loadSection(5,pageID);
this.parent.EditBird = pageID;
};
BirdInfo.prototype.getPage = function(birdID)
{
this.birdID = parseInt(birdID) - 1;
this.parent.nav.navUpdate(8,this.birdID);
this.setUpPage();
};
BirdInfo.prototype.addToMyBirds = function(linkID)
{
this.parent.mybirdsData.addToMyBirds(linkID);
this.refreshMyBirds();
};
BirdInfo.prototype.removeFromMyBirds = function(linkID)
{
this.parent.mybirdsData.removeFromMyBirds(linkID);
this.refreshMyBirds();
};
BirdInfo.prototype.refreshMyBirds = function()
{
this.parent.appTL.BBTcontent_mc.quickRef.setUpPage();
};
Diary.prototype.addMammal = function(pageID)
{
this.parent.nav.loadSection(5,Number(pageID - 1));
};
BirdInfo.prototype.playVideo = function(linkID)
{
this.contentTL.scroller_mc.scrollingMC.media_mc.tv_mc._alpha = 100;
this.listenerObject = new Object();
this.listenerObject.parent = this;
this.listenerObject.complete = function(eventObject)
{
this.parent.showReplayVideo();
};
this.contentTL.scroller_mc.scrollingMC.media_mc.tv_mc.vidPlayer_mc.addEventListener("complete",this.listenerObject);
this.videoLoaded = true;
var _loc3_ = System.capabilities.os.charAt(0);
this.contentTL.scroller_mc.scrollingMC.media_mc.tv_mc.vidPlayer_mc.autoPlay = true;
if(_loc3_ == "M")
{
this.contentTL.scroller_mc.scrollingMC.media_mc.tv_mc.vidPlayer_mc.load(mdm.Application.path + "videos:" + this.parent.guideXML.firstChild.childNodes[linkID].childNodes[0].attributes.VIDEO);
}
else
{
this.contentTL.scroller_mc.scrollingMC.media_mc.tv_mc.vidPlayer_mc.load(_global.mdmPath + "videos/" + this.parent.guideXML.firstChild.childNodes[linkID].childNodes[0].attributes.VIDEO);
}
this.contentTL.scroller_mc.scrollingMC.media_mc.tv_mc.vidPlayer_mc.play();
this.contentTL.scroller_mc.scrollingMC.media_mc.video_btn.enabled = false;
this.contentTL.scroller_mc.scrollingMC.media_mc.video_btn.gotoAndStop("_selected");
this.contentTL.scroller_mc.scrollingMC.media_mc.img_btn.enabled = true;
this.contentTL.scroller_mc.scrollingMC.media_mc.img_btn.gotoAndStop("_up");
this.contentTL.scroller_mc.scrollingMC.media_mc.sound_btn.enabled = true;
this.contentTL.scroller_mc.scrollingMC.media_mc.sound_btn.gotoAndStop("_up");
this.contentTL.scroller_mc.scrollingMC.media_mc.map_btn.enabled = true;
this.contentTL.scroller_mc.scrollingMC.media_mc.map_btn.gotoAndStop("_up");
};
BirdInfo.prototype.playSound = function(linkID)
{
this.contentTL.scroller_mc.scrollingMC.media_mc.tv_mc._alpha = 0;
this.Soundlistener = new Object();
this.Soundlistener.parent = this;
this.Soundlistener.complete = function(eventObject)
{
this.parent.showReplaySound();
};
this.contentTL.scroller_mc.scrollingMC.media_mc.tv_mc.vidPlayer_mc.addEventListener("complete",this.Soundlistener);
var _loc3_ = System.capabilities.os.charAt(0);
if(_loc3_ == "M")
{
this.contentTL.scroller_mc.scrollingMC.media_mc.tv_mc.vidPlayer_mc.load(_global.mdmPath + "sounds:" + this.parent.guideXML.firstChild.childNodes[linkID].childNodes[0].attributes.SOUND);
}
else
{
this.contentTL.scroller_mc.scrollingMC.media_mc.tv_mc.vidPlayer_mc.load(_global.mdmPath + "sounds/" + this.parent.guideXML.firstChild.childNodes[linkID].childNodes[0].attributes.SOUND);
}
this.contentTL.scroller_mc.scrollingMC.media_mc.tv_mc.vidPlayer_mc.play();
this.contentTL.scroller_mc.scrollingMC.media_mc.video_btn.enabled = true;
this.contentTL.scroller_mc.scrollingMC.media_mc.video_btn.gotoAndStop("_up");
this.contentTL.scroller_mc.scrollingMC.media_mc.img_btn.enabled = true;
this.contentTL.scroller_mc.scrollingMC.media_mc.img_btn.gotoAndStop("_up");
this.contentTL.scroller_mc.scrollingMC.media_mc.sound_btn.enabled = false;
this.contentTL.scroller_mc.scrollingMC.media_mc.sound_btn.gotoAndStop("_selected");
this.contentTL.scroller_mc.scrollingMC.media_mc.map_btn.enabled = true;
this.contentTL.scroller_mc.scrollingMC.media_mc.map_btn.gotoAndStop("_up");
};
BirdInfo.prototype.showMap = function()
{
this.contentTL.scroller_mc.scrollingMC.media_mc.pic_holder_mc._visible = false;
this.contentTL.scroller_mc.scrollingMC.media_mc.map_holder_mc._visible = true;
this.contentTL.scroller_mc.scrollingMC.media_mc.map_btn.enabled = false;
this.contentTL.scroller_mc.scrollingMC.media_mc.map_btn.gotoAndStop("_selected");
this.contentTL.scroller_mc.scrollingMC.media_mc.img_btn.enabled = true;
this.contentTL.scroller_mc.scrollingMC.media_mc.img_btn.gotoAndStop("_up");
};
BirdInfo.prototype.hideMap = function()
{
this.contentTL.scroller_mc.scrollingMC.media_mc.pic_holder_mc._visible = true;
this.contentTL.scroller_mc.scrollingMC.media_mc.map_holder_mc._visible = false;
this.contentTL.scroller_mc.scrollingMC.media_mc.map_btn.gotoAndStop("_up");
};
BirdInfo.prototype.hideVideo = function()
{
if(this.videoLoaded)
{
this.contentTL.scroller_mc.scrollingMC.media_mc.tv_mc._alpha = 0;
this.contentTL.scroller_mc.scrollingMC.media_mc.tv_mc.vidPlayer_mc.stop();
}
this.contentTL.scroller_mc.scrollingMC.media_mc.video_btn.enabled = true;
this.contentTL.scroller_mc.scrollingMC.media_mc.video_btn.gotoAndStop("_up");
this.contentTL.scroller_mc.scrollingMC.media_mc.sound_btn.enabled = true;
this.contentTL.scroller_mc.scrollingMC.media_mc.sound_btn.gotoAndStop("_up");
this.contentTL.scroller_mc.scrollingMC.media_mc.img_btn.enabled = true;
this.contentTL.scroller_mc.scrollingMC.media_mc.img_btn.gotoAndStop("_up");
this.contentTL.scroller_mc.scrollingMC.media_mc.map_btn.enabled = true;
this.contentTL.scroller_mc.scrollingMC.media_mc.map_btn.gotoAndStop("_up");
};
BirdInfo.prototype.showReplayVideo = function()
{
this.contentTL.scroller_mc.scrollingMC.media_mc.tv_mc.vidPlayer_mc.stop();
this.contentTL.scroller_mc.scrollingMC.media_mc.video_btn.enabled = true;
this.contentTL.scroller_mc.scrollingMC.media_mc.video_btn.gotoAndStop("_up");
};
BirdInfo.prototype.showReplaySound = function()
{
this.contentTL.scroller_mc.scrollingMC.media_mc.tv_mc.vidPlayer_mc.stop();
this.contentTL.scroller_mc.scrollingMC.media_mc.sound_btn.enabled = true;
this.contentTL.scroller_mc.scrollingMC.media_mc.sound_btn.gotoAndStop("_up");
};
ref_sp.drawFocus = "";
ScrollPane.drawFocus = "";
_global.styles.ScrollPane.setStyle("borderStyle","solid");
_global.styles.ScrollPane.setStyle("borderColor","0xffffff");
stop();
var birdInfo = new BirdInfo(this);